#coding=utf-8

from sys import argv

#script, filename = argv
#print "We will open file %s" % filename


'''
1、
#打开文件，open和file两者请查看官方文档，推荐使用open
txt = open(filename)

#文件的操作，这里是读操作
action = txt.read()

print "filename is <%s>, content is: \n=========\n%s" % (filename, action)

#操作完成后需要关闭文件
txt.close()
'''

'''
2、
txt_2 = open(filename)
action_2 = txt_2.read().strip()
print "filename [%s] content is :  \n=========\n%s " % (filename, action_2)
raw_input("press enter to exit.")
'''

'''
3、
txt = open('test.txt', 'r')
action = txt.readline()
while action:
	print "action %s" % action.strip()
	action = txt.readline()
	print "check action <%s>" % action
'''

'''
4、
#追加内容
#txt = open(filename, 'a+')

#覆盖操作
txt = open(filename, 'w+')

line1 = raw_input('please input line1: ')
line2 = raw_input('please input line2: ')
line3 = raw_input('please input line3: ')

txt.write(line1 + '\n')
txt.write(line2 + '\n')
#txt.write('\n')
txt.write('%s\n' % line3)
'''

'''
5、复制文件
script, infile, outfile = argv
intxt = open(infile)
buf = intxt.read()
outtxt = open(outfile, 'w+')
outtxt.write(buf)
outtxt.close()
'''

list